package Entity

class FieldEntity {

    /**
     * 成员变量名
     */
    private var name:String = ""

    /**
     * 成员变量访问类型，默认为private
     */
    private var access:String = "private"

    /**
     * 成员变量类型
     */
    private var type:String = ""


    /**
     * 是否是static变量
     */
    private var isStatic:Boolean = false

    constructor(name: String, access: String, type: String, isStatic: Boolean) {
        this.name = name
        this.access = access
        this.type = type
        this.isStatic = isStatic
    }

    constructor(name: String, type: String) {
        this.name = name
        this.type = type
    }


    /**
     * todo：不支持static
     */
    override fun toString():String {
        val sb:StringBuilder = StringBuilder();
        when(access) {
            "private" -> sb.append("-")
            "public" -> sb.append("+")
            else -> sb.append("-")
        }
        sb.append(name)
        sb.append(":")
        sb.append(type)
        return sb.toString();
    }

}